performance_should_cull_character = {
    trigger = {
        ai = yes
        NOT = { is_playable_ruler = yes }
        NOT = { is_important_character = yes }
        
        age >= 16
        is_imprisoned = no
        is_leading_army = no
        
        # Exclude close family of rulers
        NOT = {
            any_relation = {
                who = liege
                limit = {
                    is_playable_ruler = yes
                }
                relation = parent
            }
        }
        NOT = {
            any_relation = {
                who = liege
                limit = {
                    is_playable_ruler = yes
                }
                relation = spouse
            }
        }
        NOT = {
            any_relation = {
                who = liege
                limit = {
                    is_playable_ruler = yes
                }
                relation = child
            }
        }
        
        # Must not be direct vassal or liege
        NOT = {
            liege = { is_playable_ruler = yes }
        }
        NOT = {
            any_vassals = { is_playable_ruler = yes }
        }

        # Exclude active claimants
        NOT = { has_active_claim = yes }

        # Exclude regents
        is_regent = no

        # Exclude characters flagged as important
        NOT = { has_character_flag = important_character }

        # Exclude valuable characters based on stats
        NOT = {
            OR = {
                diplomacy >= 10
                martial >= 10
                stewardship >= 10
                intrigue >= 10
                learning >= 10
                prowess >= 10
            }
        }
    }
}
